/**
 * 
 */
package truerefactor.refactor;

import java.util.List;

import truerefactor.graph.ClassNode;
import truerefactor.graph.CodeGraph;
import truerefactor.graph.CodeNode;

/**
 * @author Isaac
 *
 */
public class ReplaceConditionalWithPolymorphism extends Refactoring {

    public ReplaceConditionalWithPolymorphism()
    {
        this.shortName = "RCWP";
        this.name = "Replace Conditional with Polymorphism";
        this.description = "";
    }
    
    /* (non-Javadoc)
     * @see truerefactor.refactor.Refactoring#execute(truerefactor.graph.CodeGraph)
     */
    @Override
    public void execute(CodeGraph graph)
    {
        // 1. If the conditional statement is one part of a larger method, take apart the conditional statement and use Extract Method
        
        // 2. If necessary use Move Method to place the conditional at the top of the inheritance structure.
        
        // 3. Pick one of the subclasses. create a subclass method that overrides the conditional statement method. copy the body of that leg of the conditional satement into the subclass method and adjust it to fit.
        
        // 4. Compile and test.
        
        // 5. Remove the copied leg of the conditional statement
        
        // 6. Compile and test
        
        // REpeat with each leg of the conditional statement until all legs are turned into subclass methos
        
        // Make the superclass method abstract.
        
    }
}
